
//
//  District.m
//  05-homework
//
//  Created by dllo on 16/7/11.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "District.h"

@implementation District
// 在实例方法中,self代表实例对象(调用者)
- (instancetype)initWithName:(NSString *)name{
    return [self initWithName:name number:nil];
}
// 在类方法中,self代表类对象本身
+ (instancetype)districtWithname:(NSString *)name {
    return [[self alloc] initWithName:name number:nil];
}
// 指派初始化方法
- (instancetype)initWithName:(NSString *)name
                      number:(NSString *)number{
    self = [super init];
    if (self) {
        _name = name;
        _number = number;
    }
    return self;
}
+ (instancetype)districtWithName:(NSString *)name
                          number:(NSString *)number{
    return [[self alloc] initWithName:name number:number];
}
- (instancetype)initWithTempCity:(TempCity *)tempCity{
    return [self initWithName:tempCity.cityName number:tempCity.cityNumber];
}
+ (instancetype)tempCityWithTempcity:(TempCity *)tempcity{

    return [[self alloc] initWithTempCity:tempcity];
}
@end
